﻿<local:BaseWindow
    x:Class="LenovoLegionToolkit.WPF.Windows.Dashboard.EditDashboardWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="clr-namespace:LenovoLegionToolkit.WPF.Controls"
    xmlns:local="clr-namespace:LenovoLegionToolkit.WPF.Windows"
    xmlns:resources="clr-namespace:LenovoLegionToolkit.WPF.Resources"
    xmlns:utils="clr-namespace:LenovoLegionToolkit.WPF.Utils"
    xmlns:wpfui="http://schemas.lepo.co/wpfui/2022/xaml"
    Title="{x:Static resources:Resource.EditDashboardWindow_Title}"
    Width="700"
    Height="700"
    MinWidth="600"
    MinHeight="400"
    FlowDirection="{x:Static utils:LocalizationHelper.Direction}"
    ResizeMode="CanMinimize"
    ShowInTaskbar="False"
    WindowStartupLocation="CenterOwner">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <wpfui:TitleBar
            Grid.Row="0"
            CanMaximize="false"
            ShowMaximize="false"
            ShowMinimize="false"
            UseSnapLayout="false" />

        <Grid
            Grid.Row="0"
            Height="24"
            Margin="12,8,12,8">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>

            <TextBlock
                Grid.Column="0"
                VerticalAlignment="Center"
                FontSize="12"
                IsHitTestVisible="False"
                Text="{x:Static resources:Resource.EditDashboardWindow_Title}" />
        </Grid>

        <wpfui:CardControl
            x:Name="_infoBar"
            Grid.Row="1"
            Margin="12,0,16,16"
            Icon="Info24">
            <wpfui:CardControl.Header>
                <TextBlock Text="{x:Static resources:Resource.EditDashboardWindow_Disclaimer_Message}" TextWrapping="Wrap" />
            </wpfui:CardControl.Header>
        </wpfui:CardControl>

        <controls:LoadableControl
            x:Name="_loader"
            Grid.Row="2"
            Margin="12,0,0,0"
            IndicatorVerticalAlignment="Center">
            <wpfui:DynamicScrollViewer x:Name="_groupsScrollViewer">
                <StackPanel>
                    <wpfui:CardControl Margin="0,0,16,16">
                        <wpfui:CardControl.Header>
                            <controls:CardHeaderControl Title="{x:Static resources:Resource.EditDashboardWindow_Sensors}" />
                        </wpfui:CardControl.Header>
                        <wpfui:ToggleSwitch x:Name="_sensorsSwitch" />
                    </wpfui:CardControl>
                    <StackPanel x:Name="_groupsStackPanel" Margin="0,0,16,0" />
                </StackPanel>
            </wpfui:DynamicScrollViewer>
        </controls:LoadableControl>

        <Grid
            x:Name="_applyRevertStackPanel"
            Grid.Row="3"
            Margin="12"
            Visibility="Collapsed">

            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>

            <wpfui:Button
                Grid.Column="0"
                MinWidth="120"
                Appearance="Secondary"
                Click="AddButton_Click"
                Content="{x:Static resources:Resource.Add}" />
            <wpfui:Button
                Grid.Column="1"
                MinWidth="120"
                Margin="12,0,0,0"
                Appearance="Secondary"
                Click="DefaultButton_Click"
                Content="{x:Static resources:Resource.Default}" />
            <wpfui:Button
                Grid.Column="3"
                MinWidth="120"
                Margin="12,0,0,0"
                Appearance="Primary"
                Click="ApplyButton_Click"
                Content="{x:Static resources:Resource.Apply}" />
            <wpfui:Button
                Grid.Column="4"
                MinWidth="120"
                Margin="12,0,0,0"
                Appearance="Secondary"
                Click="CancelButton_Click"
                Content="{x:Static resources:Resource.Cancel}" />
        </Grid>

    </Grid>
</local:BaseWindow>
